home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19950528-19950726 / 000016_news@columbia.edu_Wed May 31 23:35:16 1995.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Received: from apakabar.cc.columbia.edu by watsun.cc.columbia.edu with SMTP id AA21873
  2.   (5.65c+CU/IDA-1.4.4/HLK for <kermit.misc@watsun.cc.columbia.edu>); Wed, 31 May 1995 19:35:23 -0400
  3. Received: by apakabar.cc.columbia.edu id AA01252
  4.   (5.65c+CU/IDA-1.4.4/HLK for kermit.misc@watsun); Wed, 31 May 1995 19:35:21 -0400
  5. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  6. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  7. Newsgroups: comp.protocols.kermit.misc
  8. Subject: Re: Piping output from "rem host" command
  9. Date: 31 May 1995 23:35:16 GMT
  10. Organization: Columbia University
  11. Lines: 48
  12. Message-Id: <3qiufk$16r@apakabar.cc.columbia.edu>
  13. References: <Pine.PCP.3.91.950531154729.6366A-100000-100000-100000@[141.218.24.34]>
  14. Nntp-Posting-Host: watsun.cc.columbia.edu
  15. Apparently-To: kermit.misc@watsun.cc.columbia.edu
  16.  
  17. In article <Pine.PCP.3.91.950531154729.6366A-100000-100000-100000@[141.218.24.34]>,
  18. John D. Tucker <tucker@mickey.acs.wmich.edu> wrote:
  19. : I would like to send a command to a remote computer and capture a brief 
  20. : (one line of characters) response from that computer for processing 
  21. : within a script.  Reading the "Using MS-DOS Kermit" manual, I found that 
  22. :                rem host [command] > d:\log\remote.out
  23. : would capture the output from "[command]" in the file "d:\log\remote.out".
  24. : However, when using the pipe symbol (instead of the redirection symbol), 
  25. : the symbol gets sent to the remote host rather than piping the output to 
  26. : some program.
  27. : Any suggestions how I could get the response from the remote computer 
  28. : into a Kermit script variable, piped to a DOS command/executable, or 
  29. : otherwise made available WITHOUT the intermediate step of writing to a file?
  30. : Even dumping the entire contents of the communications buffer would work 
  31. : as I could probably filter out what I want.
  32. This is a tough one.  Obviously, you COULD redirect to a DOS file and then
  33. read the file into an MS-DOS Kermit variable with OPEN READ, READ, CLOSE
  34. READ.  But there is no general mechanism for getting arbitrary text from the
  35. server into a variable on the client.  However, there is something close:
  36. the REMOTE QUERY command.  If the text on the server side can be obtained
  37. from a built-in Kermit variable, a user-defined variable, or an environment
  38. variable, then REMOTE QUERY can get it.  But there is no way, currently, of
  39. getting arbitrary text (the standard output of a program or command) into
  40. one of these variables.  You would like to be able to do something like
  41. this (assuming the host was UNIX):
  42.  
  43.   remote assign \%a `command arg arg ...`
  44.   remote query user \%a
  45.  
  46. but this presently can't be done.  Similarly:
  47.  
  48.   remote host FOO=`command arg arg ...`
  49.   remote query system FOO
  50.  
  51. can't be done because the environment variable disappears as soon as it
  52. is set (rules about manipulating superior processes).
  53.  
  54. This is an idea for a future release of Kermit.  Perhaps something like:
  55.  
  56.   \fsystem(text)
  57.  
  58. runs the system command "text" and returns its standard output.  But this
  59. will be a bit tricky, since the standard output could be any length at all,
  60. even gigabytes...
  61.  
  62. - Frank